# Copyright (c) 2025, yuxinyong and contributors
# For license information, please see license.txt

import frappe
from frappe.model.document import Document
from frappe.model.naming import make_autoname
from zelin_shoe_biz.utils import extract_last_number

class ShoeHeel(Document):
	def autoname(self):
		"""
		RC-xxxxyy, xxxx是四位last_number, yy是流水号
		"""

		last_number = extract_last_number(self.last)
		self.name = make_autoname(f"RH-{last_number}.##")